package com.easycarebn.main.fragment;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.TextView;

import com.easycarebn.main.utils.ViewmoreDetailt;
import com.easycarebn.request.data.DoctorDetail;
import com.timbacsi.main.R;

public class FragmentAboutDoctor extends Fragment {

    private View mView;
    private static FragmentAboutDoctor fragment = null;
    private DoctorDetail listdocter;
    private TextView tvDrProfile;
    private TextView lblReadMore;
    
    
    public static FragmentAboutDoctor newInstance(String title) {
        if (fragment == null)
            fragment = new FragmentAboutDoctor();
        return fragment;
    }

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        mView = inflater.inflate(R.layout.aboutdoctor, null);

        return mView;
    }

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        lblReadMore = (TextView) mView.findViewById(R.id.lblReadMore);
        tvDrProfile = (TextView) mView.findViewById(R.id.tv_dr_profile);

        listdocter = FragmentDrDetailt.newInstance("").getCurrentDoctor();
        if (listdocter == null  ) {
            return;
        }
        tvDrProfile.setText(Html.fromHtml(listdocter.getProfile()));
        lblReadMore.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                new ViewmoreDetailt(getActivity(), listdocter.getProfile()).getDialogReadMore();

            }
        });
      

    }



}
